const config = {
    connectionLimit: 10,
    database: "mta",
    host: process.env.RDS_HOST,
    port: "1403",
    user: process.env.RDS_ADMIN,
    password: process.env.RDS_PASSWORD,
};
const mysql2 = require("mysql2/promise");
const pool = mysql2.createPool(config);

const query = async function (sql, args = []) {
    const result = await pool.execute(sql, args);
    return result;
};

const mta = { config, pool, query };
module.exports = mta;
